package com.awakening.demo;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.timeout.IdleStateEvent;

/**
 * @Author:AwakeningCode
 * @Date: Created in 15:33 2018\3\10 0010
 */
/*public class RequestController extends IdleStateAwareChannelUpstreamHandler{

    public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e)throws Exception{
        //Shut down connection to client and roll everything back
    }

    public void channelConnected(ChannelHandlerContext ctx,ChannelStateEvent e)throws Exception{
        if(!acquireConnectionSlot()){
            //Maximum number of allowed server connections reached,
            // respond with 503 service unavailable
            // and shutdown connection
        } else {
            // set up the connection's request pipeline
        }
    }

    public void messageReceived(ChannelHandlerContext ctx,MessageEvent e)throws Exception{
        if(isDone()){
            return;
        }
        if (e.getMessage() instanceof HttpRequest){
            handleHttpRequest((HttpRequest)e.getMessage());
        } else if (e.getMessage() instanceof HttpChunk){
            handleHttpChunk((HttpChunk)e.getMessage());
        }
    }

}*/
